package org.dtree.ow.controller;

import org.dtree.ow.models.User;
import org.dtree.ow.service.UserService;
import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;

import java.util.List;

/**
 * Created by dengwubo on 2017/9/19.
 */
@IocBean
@At("/user")
public class UserController {
    private static final Log log = Logs.get();
    @Inject
    UserService userService;


    @At("/list")
    @Ok("json")
    public Object list(){
        List<User> userList = userService.query(Cnd.where(null));

        return userList;
    }


}
